
import Vue from 'vue'//导入vue
//1.导入vur-router包
import VueRouter from 'vue-router'

//导入路由的组件
import HomeContainer from './components/tabber/HomeContainer.vue'
import MemberContainer from './components/tabber/MemberContainer.vue'
import SearchContainer from './components/tabber/SearchContainer.vue'
import ShopcarContainer from './components/tabber/ShopcarContainer.vue'
import NewsList from './components/news/newsList.vue'
import NewsInfo from './components/news/newsInfo.vue'
import Photos from './components/photos/photolist.vue'
import PhotoInfo from './components/photos/photoinfo.vue'

//3.创建路由对象
var router=new VueRouter({
    routes:[//配置路由规则
        {path:'/',redirect:'/home'},
        {path:'/home',component:HomeContainer},
        {path:'/member',component:MemberContainer},
        {path:'/search',component:SearchContainer},
        {path:'/shopcar',component:ShopcarContainer},
        {path:'/home/newsList',component:NewsList},
        {path:'/home/newsinfo/:id',component:NewsInfo},
        {path:'/home/photos',component:Photos},
        {path:'/home/photoinfo/:id',component:PhotoInfo}
    ],
    linkActiveClass:'mui-active'//覆盖默认的路由高亮（被选中）的类，默认叫做router-link-active
})
//把路由对象暴露出去
export default router